package com.biubiushop.entity;

import com.biubiushop.util.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;

@Data
@EqualsAndHashCode(callSuper=true)
@Entity
@Table(name = "orders")
@org.hibernate.annotations.Table(appliesTo = "orders",comment = "订单表")
public class Orders extends BaseEntity {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Column(nullable = false,columnDefinition = "tinyint(3) comment '购买总长度'")
	private Integer buyLength;
	
	@Column(nullable = false,columnDefinition = "decimal(8,2) comment '总金额'")
	private BigDecimal amoutMoney;
	
	@Column(columnDefinition = "varchar(128) DEFAULT NULL comment '消费地址'")
	private String address;
	
	@Column(columnDefinition = "char(32) comment '用户id'")
	private String userId;
	
	@Column(nullable = false,columnDefinition = "char(32) comment '所属设备id'")
	private String equipmentId;
	
	@Column(nullable = false,columnDefinition = "char(32) comment '商品id'")
	private String commodityId;

	@Column(nullable = false,columnDefinition = "tinyint(1) DEFAULT '0' comment '订单状态(0-待付款,1-已付款未出纸,2-已付款出纸,3-出纸失败,4-已退款)'")
	private Integer status;
	
}
